﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="ListPublisher.ascx.cs" Inherits="BSPortal.Usercontrol.Admin.Book.Publisher.ListPublisher" %>
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>

<telerik:RadWindowManager ID="RadWindowManager2" runat="server" 
    Skin="Outlook">
 </telerik:RadWindowManager>
 <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">     
 </telerik:RadAjaxManager>
    <style type="text/css">      
        .bigModuleBottom td{padding:0}
    </style>
    <script type="text/javascript">        
        function OnClientclose(sender, eventArgs) {
            var arg = eventArgs.get_argument();
            if (arg != null && arg.Modified == 'true')
                document.getElementById('<%=btnSearch.ClientID %>').click();
        }
        function resetSearch() {
            document.getElementById('<%=txtName.ClientID %>').value = "";
            return false;
        }
        function SetUsername(user) {
            document.getElementById('<%=hdId.ClientID %>').value = "";
        }
        </script>
     
<asp:UpdatePanel runat="server" ID="udpSelectMethod" RenderMode="Inline" UpdateMode="Conditional">
    <ContentTemplate>                                                            
        <table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">                
                <tr>
                <td align="left" width="100%%">
                    <fieldset class="search_fieldset">
                        <legend>HỖ TRỢ TÌM KIẾM</legend>
                        <table width="100%" border="0" cellspacing="0" cellpadding="3" class="search_form">
                            <tr>
                                <td width="5%" align="left" valign="bottom">
                                    &nbsp;
                                </td>
                                <td width="40%" align="left" valign="bottom">
                                    Nhà xuất bản&nbsp;
                                    <asp:TextBox runat="server" ID="txtName" Width="90%"></asp:TextBox>
                                </td>
                                <td align="right" valign="bottom">
                                    <asp:Button runat="server" ID="btnSearch" CssClass="Button" Text="Tìm" onclick="btnSearch_Click" 
                                    />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                    <asp:Button runat="server" ID="btnClear" CssClass="Button" Text="Nhập lại" OnClientClick ="return resetSearch();"
                                    />
                                </td>
                                <td width="10%" align="right" valign="bottom">
                                    &nbsp;
                                </td>
                            </tr>
                        </table>
                    </fieldset>
                </td>               
                </tr>                
        </table>           
        
        <table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
            <tr>
                <td align="left" style="width:50%;">
                    <div class="ListAccountTitle">
                        <h2><%=publisherNameManager%></h2></div>                        
                </td>
                <td align="right">
                <asp:UpdateProgress ID="UpdateProgress1" runat="server" AssociatedUpdatePanelID="udpSelectMethod"
                    DynamicLayout="true" DisplayAfter="10">
                    <ProgressTemplate>
                        <span class="LoadingStatus"><asp:Image ID="Image1" runat="server" ImageUrl="~/Images/loader_green.gif" />Loading.....</span>
                    </ProgressTemplate>
                </asp:UpdateProgress>
                </td>               
            </tr>
            <tr>
                 <td align="left"  valign="middle"  >                     
                     <asp:ImageButton ID="imgAdd" runat="server" ImageUrl="~/Images/AddRecord.gif" 
                         onclick="imgAdd_Click" /><a onclick="document.getElementById('<%=hdId.ClientID %>').value=''; document.getElementById('<%=imgAdd.ClientID %>').click();" >&nbsp;Thêm </a>                    
                     <asp:HiddenField ID="hdId" runat="server" />                     
                 </td>                
            </tr>
            <tr>
                 <td colspan="2" valign="top" align="center">                        
                    <telerik:RadGrid ID="RadGrid" runat="server" AllowPaging="True" GridLines="None" Skin="Outlook"  AllowAutomaticDeletes="True"                         
                        onpageindexchanged="RadGrid_PageIndexChanged" onneeddatasource="RadGrid_NeedDataSource" onitemdatabound="RadGrid_ItemDataBound" 
                            AllowCustomPaging="true" ShowStatusBar="true" >                           
                            <MasterTableView AutoGenerateColumns="False" datakeynames="PublisherId" NoMasterRecordsText="Không tìm thấy dữ liệu.">
                                <Columns>
                                    <telerik:GridTemplateColumn DataType="System.Int32" HeaderText="STT" 
                                        UniqueName="STT">
                                        <ItemTemplate>
                                            <asp:Label ID="lblSTT" runat="server" ></asp:Label>
                                        </ItemTemplate>
                                        <HeaderStyle Width="5%" />
                                        <ItemStyle HorizontalAlign="Center" />
                                    </telerik:GridTemplateColumn>
                                    <telerik:GridTemplateColumn DataField="PublisherId" HeaderText="ID" 
                                        UniqueName="PublisherId" >                                        
                                        <ItemTemplate>
                                            <asp:Label ID="lblPublisherId" runat="server" Text='<%#Eval("PublisherId") %>'></asp:Label>
                                        </ItemTemplate>
                                        <HeaderStyle Width="10%" />
                                        <ItemStyle HorizontalAlign="Center" />
                                    </telerik:GridTemplateColumn>
                                    <telerik:GridTemplateColumn DataField="Name" HeaderText="Nhà Xuất Bản" 
                                        UniqueName="Name" >                                        
                                        <ItemTemplate>
                                            <asp:Label ID="lblName" runat="server" Text='<%# Eval("Name") %>'></asp:Label>
                                        </ItemTemplate>  
                                        <HeaderStyle Width="10%" />  
                                        <ItemStyle HorizontalAlign="Center" />                                 
                                    </telerik:GridTemplateColumn>                     
                                    <telerik:GridTemplateColumn UniqueName="Update">
                                        <ItemTemplate>
                                            <asp:ImageButton ID="imgUpdate"  runat="server" 
                                                ImageUrl="~/Images/edit.gif" ToolTip="Sửa" onclick="imgUpdate_Click"/>
                                        </ItemTemplate>
                                        <HeaderStyle Width="5%" />
                                        <ItemStyle HorizontalAlign="Center" />
                                    </telerik:GridTemplateColumn>
                                    <telerik:GridTemplateColumn UniqueName="Delete">
                                        <ItemTemplate>
                                            <asp:ImageButton ID="imgDelete"  runat="server" 
                                                ImageUrl="~/Images/delete.gif" ToolTip="Xóa" onclick="imgDelete_Click"/>
                                        </ItemTemplate>
                                        <HeaderStyle Width="5%" />
                                        <ItemStyle HorizontalAlign="Center" />
                                    </telerik:GridTemplateColumn>
                                </Columns>                                                                                
                            </MasterTableView>
                            <ItemStyle HorizontalAlign="Center"/>
                            <HeaderStyle Font-Bold="True" Font-Italic="False" Font-Overline="False" 
                                Font-Strikeout="False" Font-Underline="False" HorizontalAlign="Center" 
                                VerticalAlign="Middle" Wrap="True" />
                            <clientsettings EnableRowHoverStyle="true">
                                <selecting allowrowselect="True" />                                                                                
                            </clientsettings>  
                        </telerik:RadGrid>
                 </td>
            </tr>
        </table>
        
        <telerik:RadWindowManager ID="RadWindowManager1" ShowContentDuringLoad="False"  ReloadOnShow="True" runat="server" Skin="Outlook" EnableShadow="true" 
            VisibleStatusbar="false" VisibleOnPageLoad="false" Behaviors="Close,None" DestroyOnClose="true" EnableViewState = "false">
            <Windows>
                <telerik:RadWindow ID="frmPublishser" runat="server" Modal="True" Width="400px" OnClientClose="OnClientclose" >
                </telerik:RadWindow>
            </Windows>
    </telerik:RadWindowManager>    
    </ContentTemplate>
</asp:UpdatePanel>